<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CallEdit.aspx.cs" Inherits="OrderEdit" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Service Call Log</title>
    <link href="/Style/StyleSheet.css" rel="stylesheet" type="text/css" />
    <style>
        .callstep {float:left;overflow:hidden;height:50px;width:220px;padding:3px;border-bottom:solid 1px #c0c0c0}
        .callno {float:left;overflow:hidden;height:50px;width:30px;font-size:45px;color:#c0c0c0;solid 1px #c0c0c0}
.dxbButton {   	font-size: 11px; }
</style>
</head>
<body onload="javascript:LoadMap();">
    <form id="form1" runat="server">

    <script type="text/javascript">
        function ShowEdit() {
            window.open("../Edit/Job.aspx?OrderNo=" + txt_Sn.GetText(), "name1", "width=1020,height=600,toolbar=no,scrollbars=no,menubar=no");
        }
        var clientId = null;
        var clientName = null;
        var clientAdr = null;
        var clientContact = null;
        function PutValue(s, name) {
            if (clientId != null) {
                clientId.SetText(s);
                if (clientName != null) {
                    clientName.SetText(name);
                }
                popubCtr.Hide();
                popubCtr.SetContentUrl('about:blank');
            }
        }
        function PutValue(s, name,address,contact, lat, lon) {
            if (clientId != null) {
                clientId.SetText(s);
                if (clientName != null) {
                    clientName.SetText(name);
                }
                if (clientAdr != null)
                    clientAdr.SetText(address);
                if (clientContact != null)
                    clientContact.SetText(contact);
                popubCtr.Hide();
                popubCtr.SetContentUrl('about:blank');
		document.getElementById("mapframe").contentWindow.SetMap(lat,lon,14);

            }
}

function LoadMap() {
    var la = document.getElementById("lati").innerHTML;
    var lo = document.getElementById("longi").innerHTML;
    if(la != "")
        document.getElementById("mapframe").contentWindow.SetMap(la,lo, 14);
}


            function PopupCust(txtId, txtName) {

                parent.PopupItem('/Pages/SelectPage/CustomerPick.aspx', 'Select Customer', 880, 480);
                clientId = txtId;
                clientName = txtName;
                //clientAdr = txtAdr;
                //clientContact = txtContact;
                popubCtr.SetContentUrl('/Pages/SelectPage/CustomerPick.aspx');
                popubCtr.SetHeaderText('Customer');
                popubCtr.Show();
            }

        function PopupCust2(txtId, txtName,txtAdr,txtContact) {
            clientId = txtId;
            clientName = txtName;
            clientAdr = txtAdr;
            clientContact = txtContact;
            popubCtr.SetContentUrl('/Modules/SelectPage/CustomerPick.aspx');
            popubCtr.SetHeaderText('Customer');
            popubCtr.Show();
        }

        function PopupVehicle(N) {
            parent.PopupItem('/Pages/Sales/EditPage/VehicleEdit.aspx?no=' + N+'&sn=' + txt_OrderNo.GetText(), 'Service Order / Vehicle', 880, 480);
            //popubCtr.SetHeaderText('Service Order / Vehicle');
             //popubCtr.SetContentUrl('/Pages/Sales/EditPage/VehicleEdit.aspx?no=' + N+'&sn=' + txt_OrderNo.GetText());
             //popubCtr.Show();
        }

        function PopupUploadPhoto() {
            popubCtr.SetHeaderText('Upload Documents');
            popubCtr.SetContentUrl('../Upload.aspx?Sn=' + txt_Sn.GetText());
            popubCtr.Show();
        }
        function PopupUploadPhotoServer() {
            popubCtr1.SetHeaderText('Upload Documents');
            popubCtr1.SetContentUrl('/Pages/UploadFromServer.aspx?sn=' + txt_OrderNo.GetText());
            popubCtr1.Show();
        }
        function AfterUploadPhoto() {
            popubCtr.Hide();
            popubCtr.SetContentUrl('about:blank');
        }


        var grid = null;
        function AddBill(gridId) {
            grid = gridId;
            popubCtr1.SetHeaderText('Invoice');
            popubCtr1.SetContentUrl('/Modules/Account/EditPage/InvoiceEdit.aspx?InvN=0&sn=' + txt_OrderNo.GetText());
            popubCtr1.Show();
        }
        function ShowBill(gridId, no) {
            grid = gridId;
            popubCtr1.SetHeaderText('Invoice');
            popubCtr1.SetContentUrl('/Modules/Account/EditPage/InvoiceEdit.aspx?InvN=' + no + '&sn=' + txt_OrderNo.GetText());
            popubCtr1.Show();
        }
        function PrintEstimate() {
            window.open("/Reports/printview.aspx?doc=51&no=" + txt_OrderNo.GetText());
        }
        


        function OnCallback(v) {
            alert(v);
        }
        ////////////////for dropdown list
        function RowClickHandler(s, e) {
            SetLookupKeyValue(e.visibleIndex);
            de_Cust.HideDropDown();
        }
        function SetLookupKeyValue(rowIndex) {
            de_Cust.SetText(gridPopCont.cpKeyValues[rowIndex]);
            txt_CustName.SetText(gridPopCont.cpName[rowIndex]);
            txtAddress.SetText(gridPopCont.cpAddress[rowIndex]);
            txt_CustContact.SetText(gridPopCont.cpContact[rowIndex]);
        }

        /////////////////////////////////////////////////////////////////////////////////////////////////
  </script>

    <div>
         <asp:SqlDataSource ID="dsPickSource" runat="server" ConnectionString="Server=.\Sqlexpress;DataBase=colorworksDB;UID=sa;PWD=1234;"
         SelectCommand="select ddItemCode as Code, ddItemId as Id from ddItems where ddItemStatus='Active' and ddGroupId=1003 order by ddItemSort"  />
         <asp:SqlDataSource ID="dsPickServiceType" runat="server" ConnectionString="Server=.\Sqlexpress;DataBase=colorworksDB;UID=sa;PWD=1234;"
         SelectCommand="select ddItemCode as Code, ddItemId as Id from ddItems where ddItemStatus='Active' and ddGroupId=1009 order by ddItemSort"  />
         <asp:SqlDataSource ID="dsPickOrderStatus" runat="server" ConnectionString="Server=.\Sqlexpress;DataBase=colorworksDB;UID=sa;PWD=1234;"
         SelectCommand="select ddItemCode as Code, ddItemId as Id from ddItems where ddItemStatus='Active' and ddGroupId=1010 order by ddItemSort"  />
         <asp:SqlDataSource ID="dsPickTech" runat="server" ConnectionString="Server=.\Sqlexpress;DataBase=colorworksDB;UID=sa;PWD=1234;"
         SelectCommand="select firstname as Code, EmployeeID from [BoEmployee] where EmployeeGroupID=119 order by firstname"  />
         <asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="Server=.\Sqlexpress;DataBase=colorworksDB;UID=sa;PWD=1234;"
         SelectCommand="select ddItemCode as Code, ddItemId as Id from ddItems where ddItemStatus='Active' and ddGroupId=1003 order by ddItemSort"  />
        <asp:SqlDataSource ID="dsPickClientGroup" SelectCommand="select ddItemCode as Code, ddItemId as Id from ddItems where ddItemStatus='Active' and ddGroupId=1011 order by ddItemSort" runat="server" ConnectionString="Server=.\Sqlexpress;DataBase=colorworksDB;UID=sa;PWD=1234;"  />
        <wilson:DataSource ID="dsBranch" TypeName="Touchmax.BoBranch" KeyMember="BranchID" FilterExpression="1=1" runat="server" ObjectSpace="Touchmax.Manager.ORManager"/>

<wilson:DataSource ID="dsCombo" TypeName="Touchmax.FaItem" KeyMember="ItemID" FilterExpression="1=1" runat="server" ObjectSpace="Touchmax.Manager.ORManager"/>



         <wilson:DataSource ID="dsCust" runat="server" ObjectSpace="Touchmax.Manager.ORManager"
                TypeName="Touchmax.BoClient" KeyMember="CustId" FilterExpression="1=1" />
        <wilson:DataSource ID="dsJobOrder" runat="server" ObjectSpace="Touchmax.Manager.ORManager"
            TypeName="Touchmax.OpOrder" KeyMember="Oid" FilterExpression="1=0" />
        <wilson:DataSource ID="dsCall" runat="server" ObjectSpace="Touchmax.Manager.ORManager"
            TypeName="Touchmax.OpActivity" KeyMember="ActivityID" FilterExpression="1=0" />

        <dxwgv:ASPxGridView ID="grid_Order" ClientInstanceName="grid_Order" runat="server"
            DataSourceID="dsCall" Width="1000" KeyFieldName="ActivityID" AutoGenerateColumns="False"
            OnInit="grid_Order_Init" OnInitNewRow="grid_Order_InitNewRow" OnRowUpdating="call_Updating"
            OnCustomDataCallback="grid_Order_CustomDataCallback" OnHtmlEditFormCreated="grid_Order_HtmlEditFormCreated">
            <SettingsPager Mode="ShowAllRecords">
            </SettingsPager>
            <SettingsEditing Mode="EditForm" />
            <SettingsCustomizationWindow Enabled="True" />
            <Settings ShowColumnHeaders="false" />
            <Templates>
                <EditForm>

                <table cellspacing=4 width=990>
                <tr>
                <td style="width:500px;border:solid 1px gray;font-weight:bold;" align="center">
                    <div style="float:left;width:200px;font-size:15px;font-weight:bold;">
                    Call Log Process : <%# Eval("ActivityID") %>
                    </div>
                    <div style="float:right;text-align:right;padding-right:10px;width:150px;font-size:15px;font-weight:bold;">
                    00:00:00
                    </div>
                    
                </td>
                <td style="width:480px;border:solid 1px gray;font-weight:bold;" align="center">
                    <div style="float:left;width:200px;font-size:15px;font-weight:bold;">
                    Service Options
                    </div>
                </td>
                </tr>
                <tr>
                <td style="width:500px;border:solid 1px gray" valign="top">
                
                <div id="step1" class="callstep">
                <i>Have you ever used us before ?</i><br />

                                    <dxe:ASPxRadioButtonList ID="ASPxRadioButtonList1" Value='<%# Bind("NewClientStatus") %>' Width="140"  RepeatDirection="Horizontal"  runat="server"  TabIndex="12">
                  <Items>
                  <dxe:ListEditItem Text="Yes" Value="No" />
                  <dxe:ListEditItem Text="No" Value="Yes"/>
                  </Items>
                   </dxe:ASPxRadioButtonList>



                </div>
                                <div id="step5" class="callstep">
                                              <i>How the customer know our services ?</i><br />
                                <dxe:ASPxComboBox ID="cmb_JobSource" Width="140" runat="server"  Text='<%# Bind("CallSource") %>' DataSourceID="dsPickSource" ValueField="Code" TextField="Code"  TabIndex="9">
                                </dxe:ASPxComboBox>
                                </div>
                <div class="callno"><i>1</i></div>
                <div id="step1a" class="callstep">
                <i>Create Customer Now ?</i><br />
                <dxe:ASPxButton ID="ASPxButton2" Width="110"  runat="server" Text="New Customer"  AutoPostBack="false" UseSubmitBehavior="false" >
                                    <ClientSideEvents Click="function(s,e) {
                                    PopupCust(txt_CustCode,txt_CustName);
                                    }" />
                                    </dxe:ASPxButton>
                </div>
                <div id="step1b" class="callstep">
                <i>Please choose the customer :</i><br />
                <dxe:ASPxButton ID="ASPxButton1" Width="110"  runat="server" Text="Pick Customer" AutoPostBack="false" UseSubmitBehavior="false" >
                                    <ClientSideEvents Click="function(s,e) {
                                    PopupCust(txt_CustCode,txt_CustName);
                                    }" />
                                    </dxe:ASPxButton>
                </div>
                <div class="callno"><i>2</i></div>
                <div id="step2" class="callstep">
                <i>What type of client ?</i><br />
                    
                  <dxe:ASPxComboBox ID="cbType" Width="140" Text='<%# Bind("ClientType") %>' runat="server" TabIndex="12">
                  <Items>
                  <dxe:ListEditItem Text="Retail" Value="Retail" />
                  <dxe:ListEditItem Text="Dealer" Value="Dealer" />
                  <dxe:ListEditItem Text="Rental" Value="Rental" />
                  <dxe:ListEditItem Text="Insurance" Value="Insurance" />
                  </Items>
                   </dxe:ASPxComboBox>
                    </div>
                <div class="callstep">
                <i>What about the caller ?</i>
                    <dxe:ASPxRadioButtonList ID="cbSex"  value='<%# Bind("CalllerSex") %>' Width="140"  RepeatDirection="Horizontal"  runat="server"  TabIndex="12">
                  <Items>
                  <dxe:ListEditItem Text="Female" Value="Female" />
                  <dxe:ListEditItem Text="Male" Value="Male"/>
                  </Items>
                   </dxe:ASPxRadioButtonList>
                    
                </div>

                <div class="callno"><i>3</i></div>

                <div id="step3" class="callstep">
                <i>Assign Technician Now ?</i><br />
                                                <dxe:ASPxComboBox ID="cpTech" Width="140" runat="server" Text='<%# Bind("Technician") %>' DataSourceID="dsPickTech" ValueField="Code" TextField="Code"  TabIndex="12">
                                </dxe:ASPxComboBox>
                </div>
                <div id="step6" class="callstep">
                <i>What is the status ?</i><br />
                <dxe:ASPxComboBox ID="ASPxComboBox5" BackColor="lightgreen" Width="140" runat="server" Text='<%# Bind("CallStatus") %>' DataSourceID="dsPickOrderStatus" ValueField="Code" TextField="Code"  TabIndex="13">
                                </dxe:ASPxComboBox>
                </div>

                <div class="callno"><i>4</i></div>

                <div class="callstep">
                <i>Appointment Date</i><br />
                <dxe:ASPxDateEdit ID="dd" runat="server" value='<%# Bind("AppointmentDate") %>' EditFormat="Custom" EditFormatString="dd/MM/yyyy" DisplayFormatString="dd/MM/yyyy" ></dxe:ASPxDateEdit>
                </div>
                <div class="callstep">
                <i>Time / Hour</i><br />
                <table>
                <tr>
                <td>
                                <dxe:ASPxComboBox ID="ASPxComboBox6" Width="60" runat="server" Text='<%# Bind("Time1") %>'  TabIndex="12">
                                    <Items>
                                    <dxe:ListEditItem Text="08:00" Value="08:00"/>
                                    <dxe:ListEditItem Text="08:30"  Value="08:30" />
                                    <dxe:ListEditItem Text="09:00"  Value="09:00" />
                                    <dxe:ListEditItem Text="09:30"  Value="09:30" />
                                    <dxe:ListEditItem Text="10:00"  Value="10:00" />
                                    <dxe:ListEditItem Text="10:30"  Value="10:30" />
                                    <dxe:ListEditItem Text="11:00"  Value="11:00" />
                                    <dxe:ListEditItem Text="11:30"  Value="11:30" />
                                    <dxe:ListEditItem Text="12:00"  Value="12:00" />
                                    <dxe:ListEditItem Text="12:30"  Value="12:30" />
                                    <dxe:ListEditItem Text="13:00"  Value="13:00" />
                                    <dxe:ListEditItem Text="13:30"  Value="13:30" />
                                    <dxe:ListEditItem Text="14:00"  Value="14:00" />
                                    <dxe:ListEditItem Text="14:30"  Value="14:30" />
                                    <dxe:ListEditItem Text="15:00"  Value="15:00" />
                                    <dxe:ListEditItem Text="15:30"  Value="15:30" />
                                    <dxe:ListEditItem Text="16:00"  Value="16:00" />
                                    <dxe:ListEditItem Text="16:30"  Value="16:30" />
                                    <dxe:ListEditItem Text="17:00"  Value="17:00" />
                                    <dxe:ListEditItem Text="17:30"  Value="17:30" />
                                    <dxe:ListEditItem Text="18:00"  Value="18:00" />
                                    </Items>
                                </dxe:ASPxComboBox>
                </td>
                <td> - </td>
                <td>
                                <dxe:ASPxComboBox ID="ASPxComboBox4" Width="60" runat="server" Text='<%# Bind("Time2") %>'  TabIndex="12">
                                    <Items>
                                    <dxe:ListEditItem Text="08:00" Value="08:00"/>
                                    <dxe:ListEditItem Text="08:30"  Value="08:30" />
                                    <dxe:ListEditItem Text="09:00"  Value="09:00" />
                                    <dxe:ListEditItem Text="09:30"  Value="09:30" />
                                    <dxe:ListEditItem Text="10:00"  Value="10:00" />
                                    <dxe:ListEditItem Text="10:30"  Value="10:30" />
                                    <dxe:ListEditItem Text="11:00"  Value="11:00" />
                                    <dxe:ListEditItem Text="11:30"  Value="11:30" />
                                    <dxe:ListEditItem Text="12:00"  Value="12:00" />
                                    <dxe:ListEditItem Text="12:30"  Value="12:30" />
                                    <dxe:ListEditItem Text="13:00"  Value="13:00" />
                                    <dxe:ListEditItem Text="13:30"  Value="13:30" />
                                    <dxe:ListEditItem Text="14:00"  Value="14:00" />
                                    <dxe:ListEditItem Text="14:30"  Value="14:30" />
                                    <dxe:ListEditItem Text="15:00"  Value="15:00" />
                                    <dxe:ListEditItem Text="15:30"  Value="15:30" />
                                    <dxe:ListEditItem Text="16:00"  Value="16:00" />
                                    <dxe:ListEditItem Text="16:30"  Value="16:30" />
                                    <dxe:ListEditItem Text="17:00"  Value="17:00" />
                                    <dxe:ListEditItem Text="17:30"  Value="17:30" />
                                    <dxe:ListEditItem Text="18:00"  Value="18:00" />
                                    </Items>
                                </dxe:ASPxComboBox>
                </td>
                </tr>
                </table>
                </div>
                                <div style="float:left;padding:4px;width:420px;">
                                    <dxe:ASPxMemo ID="ASPxMemo1" Width="420" Rows="6" runat="server" Text='<%# Bind("CallNote") %>' TabIndex="4">
                                </dxe:ASPxMemo>

                </div>


                </td>
                <td style="width:450px;border:solid 1px gray" valign="top">

                                        <div style="display:none">
                                        <div id="lati"><%# Eval("Latitude") %></div>
                                        <div id="longi"><%# Eval("Longitude") %></div>

                                        <dxe:ASPxTextBox ID="txt_CustName" ClientInstanceName="txt_CustName" ReadOnly="true"  TabIndex="0"
                                                BackColor="Control" Width="150"   runat="server" Text='<%# Eval("CustName") %>'>
                                            </dxe:ASPxTextBox>

                    <div style="padding-left:0px;border:solid 2px gray;width:240px;height:160px;">
                            <iframe id="mapframe" frameborder=0 border=0 width=240 height=160 src="/framework/map.html"></iframe>
                            </div>


                                   </div>
                            <div>
                            
                            <wilson:DataSource ID="ds1" TypeName="Touchmax.FaRate" KeyMember="RateID" FilterExpression="BranchID=1001" runat="server" ObjectSpace="Touchmax.Manager.ORManager"/>
<dxwgv:ASPxGridView ID="grid1" ClientInstanceName="grid2" runat="server" DataSourceID="ds1" KeyFieldName="RateID" 
        Width="460" AutoGenerateColumns="False"  EnableCallBacks="False" >
                <SettingsPager Mode="ShowAllRecords"/>
                <Settings ShowVerticalScrollBar="true" VerticalScrollableHeight="150" />
                <Columns>
             
                    <dxwgv:GridViewDataComboBoxColumn Caption="Charge Code" ReadOnly="true" FieldName="ChargeID" VisibleIndex="1">
                        <PropertiesComboBox DataSourceID="dsCombo" TextField="ItemName" ValueField="ItemID" EnableSynchronization="False"
                    EnableIncrementalFiltering="True">
                </PropertiesComboBox>
                    </dxwgv:GridViewDataComboBoxColumn>
                    <dxwgv:GridViewDataColumn Caption="Retail" FieldName="Rate1" VisibleIndex="2"></dxwgv:GridViewDataColumn>
                    <dxwgv:GridViewDataColumn Caption="Dealer" FieldName="Rate2" VisibleIndex="3"></dxwgv:GridViewDataColumn>
                    <dxwgv:GridViewDataColumn Caption="Other" FieldName="Rate3" VisibleIndex="4"></dxwgv:GridViewDataColumn>
                               
                    </Columns>
                    <SettingsEditing Mode="Inline" />
      
                <Settings ShowGroupPanel="False" ShowFooter="False" ShowTitlePanel="false" ShowColumnHeaders="True" />
            </dxwgv:ASPxGridView>

<br>

<wilson:DataSource ID="dsCity" TypeName="Touchmax.DdCity" KeyMember="CityID" FilterExpression="1=1" runat="server" ObjectSpace="Touchmax.Manager.ORManager"/>
<asp:SqlDataSource ID="dsPickTech" runat="server" ConnectionString="Server=.\Sqlexpress;DataBase=colorworksDB;UID=sa;PWD=1234;"
         SelectCommand="select EmployeeID, Firstname  as Code from [BoEmployee] where EmployeeGroupID=119 order by firstname"  />
<asp:SqlDataSource ID="dsPickPrimaryColor" SelectCommand="select ddItemCode as Code, ddItemId as Id from ddItems where ddItemStatus='Active' and ddGroupId=1012 order by ddItemSort" runat="server" ConnectionString="Server=.\Sqlexpress;DataBase=colorworksDB;UID=sa;PWD=1234;"  />
 
<wilson:DataSource ID="ds2" TypeName="Touchmax.BoZone" KeyMember="ZoneID" FilterExpression="ZoneID=1101" runat="server" ObjectSpace="Touchmax.Manager.ORManager"/>
<dxwgv:ASPxGridView ID="grid2" ClientInstanceName="grid2" runat="server" DataSourceID="ds2" KeyFieldName="ZoneID" 
        Width="460" AutoGenerateColumns="False"  EnableCallBacks="False">
                <SettingsPager Mode="ShowAllRecords"/>
                <Columns>
        
                    <dxwgv:GridViewDataComboBoxColumn Caption="Branch" ReadOnly="true" FieldName="BranchID" VisibleIndex="1">
                        <PropertiesComboBox DataSourceID="dsBranch" TextField="BranchName" ValueField="BranchID" EnableSynchronization="False"  EnableIncrementalFiltering="True"></PropertiesComboBox>
                    </dxwgv:GridViewDataComboBoxColumn>         
                    <dxwgv:GridViewDataColumn Caption="Zone Name" Width="200" FieldName="ZoneName" VisibleIndex="2"></dxwgv:GridViewDataColumn>
                    <dxwgv:GridViewDataComboBoxColumn Caption="Primary Technician"  FieldName="Tech1ID" VisibleIndex="3">
                        <PropertiesComboBox DataSourceID="dsPickTech" TextField="Code" ValueField="EmployeeID" EnableSynchronization="False"  EnableIncrementalFiltering="True"></PropertiesComboBox>
                    </dxwgv:GridViewDataComboBoxColumn>         
                    <dxwgv:GridViewDataComboBoxColumn Caption="Secondary Technician"  FieldName="Tech2ID" VisibleIndex="4">
                        <PropertiesComboBox DataSourceID="dsPickTech" TextField="Code" ValueField="EmployeeID" EnableSynchronization="False"  EnableIncrementalFiltering="True"></PropertiesComboBox>
                    </dxwgv:GridViewDataComboBoxColumn>         
                    <dxwgv:GridViewDataComboBoxColumn width="70" Caption="Display Color" FieldName="DisplayColor" VisibleIndex="7">
                        <DataItemTemplate>
                            <div style='height:20px;background:<%# Eval("DisplayColor")%>'></div>
                        </DataItemTemplate>
                        <EditItemTemplate>
                            <input type="hidden" id="ColorValue"  runat="server" value='<%# Bind("DisplayColor") %>' />
                            <div style='text-align:center;width:80px;height:20px;background:<%# Eval("DisplayColor")%>' onclick="showColor(this);">...</div>
                            
                        </EditItemTemplate>
                    </dxwgv:GridViewDataComboBoxColumn>         
                    </Columns>
                


                    <SettingsEditing Mode="Inline" />
      
                <Settings ShowGroupPanel="False" ShowFooter="False" ShowTitlePanel="false" ShowColumnHeaders="true" />
                <SettingsBehavior ConfirmDelete="True" AllowFocusedRow="true" ProcessFocusedRowChangedOnServer="true" />
            </dxwgv:ASPxGridView>

<br>
<wilson:DataSource ID="ds3" TypeName="Touchmax.BoArea" KeyMember="AreaID" FilterExpression="AreaID=2" runat="server" ObjectSpace="Touchmax.Manager.ORManager"/>

<dxwgv:ASPxGridView ID="detailGrid" runat="server" DataSourceID="ds3" 
                                    KeyFieldName="AreaID" Width="460" 
                                    >
                                    <%-- BeginRegion Grid Columns --%>
                                    <SettingsEditing Mode="Inline" />
                                    <Columns>
                            

                                        <dxwgv:GridViewDataComboBoxColumn Caption="City" FieldName="CityID" VisibleIndex="2">
                                            <PropertiesComboBox DataSourceID="dsCity" TextField="CityName" ValueField="CityID" EnableSynchronization="False"  EnableIncrementalFiltering="True"></PropertiesComboBox>
                                        </dxwgv:GridViewDataComboBoxColumn>         
                                        <dxwgv:GridViewDataSpinEditColumn width="70" Caption="Households" FieldName="HouseHold" VisibleIndex="4"></dxwgv:GridViewDataSpinEditColumn>
                                         <dxwgv:GridViewDataSpinEditColumn width="70" Caption="Rates Factor" FieldName="PriceFactor" VisibleIndex="6"></dxwgv:GridViewDataSpinEditColumn>
                                        <dxwgv:GridViewDataColumn Caption="Zip Code" width="70" FieldName="PostCode" VisibleIndex="1" />                            
                                    </Columns>
                                    <%-- EndRegion --%>
                                    <Settings ShowFooter="True" />
                      
                                    <SettingsDetail IsDetailGrid="true"/>
                                </dxwgv:ASPxGridView>
                            
                            </div>

                </td>
       
                </tr>
                </table>
    
                </EditForm>
            </Templates>
        </dxwgv:ASPxGridView>
                
                    <table width="990">
                    <tr>
              <td nowrap>
                <dxe:ASPxButton ID="ASPxButton13" Width="120" runat="server" Enabled="false" Text="Issue Service Order" AutoPostBack="false"
                                    UseSubmitBehavior="false">
                                    <ClientSideEvents Click='function(s,e) {
                                                        grid_Order.GetValuesOnCustomCallback("IssueOrder",OnCallback);
                                                        }' />
                                </dxe:ASPxButton>
                </td>
                <td nowrap>
                <dxe:ASPxButton ID="btn_Save1" Width="120" runat="server" Text="Save Call Log" AutoPostBack="false"
                                    UseSubmitBehavior="false">
                                    <ClientSideEvents Click="function(s,e) {
                                                            setTimeout('LoadMap();',6000);
                                                            grid_Order.UpdateEdit();
                                                        }" />
                                </dxe:ASPxButton>
                </td>
                <td width="100%">&nbsp;&nbsp;&nbsp;
                </td>
</tr></table>

        <dxpc:ASPxPopupControl id="popubCtr" runat="server" CloseAction="CloseButton" Modal="True"
            PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter" ClientInstanceName="popubCtr"
            HeaderText="Customer" AllowDragging="True" EnableAnimation="False" height="360"
            AllowResize="True" width="750" EnableViewState="False">
        </dxpc:ASPxPopupControl>
        <dxpc:ASPxPopupControl id="popubCtr1" runat="server" CloseAction="CloseButton" Modal="True"
            PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter" ClientInstanceName="popubCtr1"
            HeaderText="Customer" AllowDragging="True" EnableAnimation="False" height="450"
            AllowResize="True" width="800" EnableViewState="False">
            <clientsideevents closeup="function(s, e) {
            
}" />
        </dxpc:ASPxPopupControl>
    </div>
    </form>
</body>
<style>
.dxbButton {   	font-size: 11px; height:18px; }
.dxeEditArea { font-size:11px; height:17px;}
</style>
</html>
